#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#

# -*- mode: python; -*-

import platform

Import('BuildEnv')

env = BuildEnv.Clone()
env.Append(CPPPATH = '#vrouter/include')
if platform.system() == 'Windows':
    env.Append(CPPPATH = '#vrouter/windows')
env.Append(CPPPATH = env['TOP'] + '/vrouter/sandesh')
env.Append(CPPPATH = env['TOP'] + '/vnsw/agent')
env.Append(CPPPATH = env['TOP'] + '/sandesh')
env.Append(CPPPATH = env['TOP'] + '/ksync')

env.CppEnableExceptions()

# Generate the source files
SandeshGenFiles = env.SandeshGenCpp('ksync.sandesh')
SandeshGenSrcs = env.ExtractCpp(SandeshGenFiles)

# Basic KSync library
libksync = env.Library('ksync', SandeshGenSrcs + ['ksync_object.cc'])

# KSync Netlink library
libksyncnl_src = ['ksync_tx_queue.cc', 'ksync_netlink.cc', 'ksync_sock.cc', 'ksync_sock_user.cc']
if platform.system() != 'Windows':
    libksyncnl_src.append('ksync_sock_tcp.cc')
    libksyncnl_src.append('ksync_sock_uds.cc')
libksyncnl = env.Library('ksyncnl', libksyncnl_src)

env.SConscript('test/SConscript', exports='BuildEnv', duplicate = 0)
